🎖️GitЯра🎖️
Commit 6d67fb1513bee9b478d8b2bc3fe94923d1b92910
Parents : 72f2d39
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-08-13T18:36:29Z
Committer : GitHub <noreply@github.com>
Date : 2026-08-13T18:36:29Z
fix(ci): commit the baseline profile the scheduled job already generates (#6681)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Changes
2 files changed, 38 insertions(+), 8 deletions(-)
Diff
diff --git a/.github/workflows/scheduled-baseline.yml b/.github/workflows/scheduled-baseline.yml
index 7787913263..3c0cfc4b73 100644
--- a/.github/workflows/scheduled-baseline.yml
+++ b/.github/workflows/scheduled-baseline.yml
@@ -50,6 +50,11 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
+ # Lets the detection step below prove the profile was written by *this* run rather than
+ # accepting the one already committed in the checkout.
+ - name: Mark generation start
+ run: touch "$RUNNER_TEMP/baseline-start"
+
- name: Generate Baseline Profile
id: generate_baseline
continue-on-error: true # Emulator flakiness must not block the graphs PR.
@@ -61,7 +66,8 @@ jobs:
profile: pixel_6
disable-animations: true
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
- # Writes androidApp/src/google/generated/baselineProfiles/ via the androidx.baselineprofile plugin.
+ # Writes androidApp/src/<variant>/generated/baselineProfiles/ via the androidx.baselineprofile plugin.
+ # The variant is googleRelease (flavor + buildType), NOT the bare `google` flavor dir.
# --no-configuration-cache: the underlying connectedGoogleNonMinifiedReleaseAndroidTest task is not
# config-cache serializable (SeparateTestModuleTestData / ResolutionBackedFileCollection), and the
# project enables org.gradle.configuration-cache by default — same workaround used in reusable-check.yml.
@@ -72,15 +78,30 @@ jobs:
- name: Detect baseline profile changes
id: baseline
run: |
- profile_dir="androidApp/src/google/generated/baselineProfiles"
outcome="${{ steps.generate_baseline.outcome }}"
+ # Pin the variant the Gradle task above targets: googleRelease (flavor + buildType), NOT the
+ # bare `google` flavor dir. Searching for any baseline-prof.txt would happily validate another
+ # variant's file — or, once this profile is committed, the stale one already in the checkout.
+ profile_dir="androidApp/src/googleRelease/generated/baselineProfiles"
+ profile="$profile_dir/baseline-prof.txt"
if [ "$outcome" != "success" ]; then
- echo "::warning::Baseline profile generation failed (outcome: $outcome). Skipping."
+ echo "::error::Baseline profile generation failed (outcome: $outcome)."
+ echo "status=error" >> "$GITHUB_OUTPUT"
+ elif [ ! -s "$profile" ] || [ ! "$profile" -nt "$RUNNER_TEMP/baseline-start" ]; then
+ # Absent, empty, or untouched by this run. The mtime half catches a no-op generation that
+ # leaves the committed profile in place, which would otherwise read as a clean "unchanged".
+ echo "::error::Generation reported success but did not write a non-empty $profile during this run."
+ echo "Profiles present in the tree (empty = none, a listing here points at a variant rename):"
+ find androidApp/src -type f -name '*-prof.txt' -exec ls -l {} +
echo "status=error" >> "$GITHUB_OUTPUT"
- elif [ -n "$(git status --porcelain "$profile_dir" 2>/dev/null)" ]; then
- echo "status=updated" >> "$GITHUB_OUTPUT"
else
- echo "status=unchanged" >> "$GITHUB_OUTPUT"
+ echo "dir=$profile_dir" >> "$GITHUB_OUTPUT"
+ echo "Baseline profile at $profile_dir ($(wc -l < "$profile") rules)."
+ if [ -n "$(git status --porcelain -- "$profile_dir")" ]; then
+ echo "status=updated" >> "$GITHUB_OUTPUT"
+ else
+ echo "status=unchanged" >> "$GITHUB_OUTPUT"
+ fi
fi
- name: Build PR body
@@ -128,7 +149,15 @@ jobs:
# `git add <glob>` aborts with "pathspec did not match any files", which would hard-fail this step
# and defeat the continue-on-error on the generation step above.
add-paths: |
- ${{ steps.baseline.outputs.status == 'updated' && 'androidApp/src/google/generated/baselineProfiles/**' || '' }}
+ ${{ steps.baseline.outputs.status == 'updated' && format('{0}/**', steps.baseline.outputs.dir) || '' }}
**/README.md
labels: |
automation
+
+ # Runs after the PR so graph updates still land, but turns the run red: a silently-green
+ # baseline job let a path mismatch discard a freshly generated profile every night for weeks.
+ - name: Fail the run if baseline generation broke
+ if: steps.baseline.outputs.status == 'error'
+ run: |
+ echo "::error::Baseline profile was not regenerated — see the 'Generate Baseline Profile' step."
+ exit 1
diff --git a/baselineprofile/src/main/kotlin/org/meshtastic/baselineprofile/BaselineProfileGenerator.kt b/baselineprofile/src/main/kotlin/org/meshtastic/baselineprofile/BaselineProfileGenerator.kt
index 7928374083..b06c66b016 100644
--- a/baselineprofile/src/main/kotlin/org/meshtastic/baselineprofile/BaselineProfileGenerator.kt
+++ b/baselineprofile/src/main/kotlin/org/meshtastic/baselineprofile/BaselineProfileGenerator.kt
@@ -34,7 +34,8 @@ import org.junit.runner.RunWith
*
* The [androidx.baselineprofile] plugin on `:androidApp` drives this against the auto-created
* `nonMinifiedRelease` variant and merges the result into
- * `androidApp/src/google/generated/baselineProfiles/`. Commit that output so release builds ship it.
+ * `androidApp/src/googleRelease/generated/baselineProfiles/`. Commit that output so release builds ship
+ * it.
*
* The journey is intentionally minimal (cold start → first frame) because CI has no paired radio.
* Extend it with post-connection screens (node list, map, message thread) once a fake transport or
Served by rngit 1.5.0 - Generated in 0.05s